import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/question/page',
    method: 'get',
    params: query
  })
}

export function fetchQuestionList(query) {
  return request({
    url: '/question/list',
    method: 'get',
    params: query
  })
}

export function addQuestion(obj) {
  return request({
    url: '/question/addQuestion',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/question/' + id,
    method: 'get'
  })
}


export function addObj(obj) {
  return request({
    url: '/question',
    method: 'post',
    data: obj
  })
}

export function putObj(obj) {
  return request({
    url: '/question',
    method: 'put',
    data: obj
  })
}

export function delObj(id) {
  return request({
    url: '/question/' + id,
    method: 'delete'
  })
}

export function uploadQuestion(obj) {
  return request({
    url: '/question/upload',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data: obj
  })
}
